<?php

namespace app\controllers;


use yii\data\Pagination;
use yii\db\Query;
use yii\web\Controller;
class ResumeController extends AdminBaseController {


    //数据列表
    public function actionIndex(){
         if ($this->post()){
             $nickName=\Yii::$app->request->post()['nickName'];
             $query=(new Query())->select('*')->from('yii_user')->where(['like','nickName',$nickName]);
         }else{
             $query=(new Query())->select('*')->from('yii_user');
         }

         $pages=new Pagination(['totalCount' =>$query->count()]);
         $pages->defaultPageSize = 10;//每页10条
         $list=$query->offset($pages->offset)->limit($pages->limit)->all();
         return $this->render('index',['list'=>$list,'pages'=>$pages]);
    }

}
